package com.library.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.library.entity.Book;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.library.vo.PageVO;

/**
 * 书籍Service接口
 *
 * @author Library Team
 */
public interface BookService extends IService<Book> {

    /**
     * 分页查询书籍
     */
    PageVO<Book> getBookPage(Long current, Long size, String title, String author, String category);

    /**
     * 添加书籍
     */
    boolean addBook(Book book);

    /**
     * 更新书籍
     */
    boolean updateBook(Book book);

    /**
     * 删除书籍
     */
    boolean deleteBook(Long id);

    /**
     * 根据ID查询书籍
     */
    Book getBookById(Long id);

    /**
     * 更新书籍可借数量
     */
    boolean updateAvailableQuantity(Long id, Integer quantity);

}
